Test that SRD() and restartIce() don't error with pc.close(). Differential Revision: https://phabricator.services.mozilla.com/D124842 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1729405 gecko-commit: b50031080353af94f81542477a3c8583cb964fd8 gecko-reviewers: bwc
diff --git a/webrtc/RTCPeerConnection-setRemoteDescription.html b/webrtc/RTCPeerConnection-setRemoteDescription.html index 3f335d7..c170f76 100644 --- a/webrtc/RTCPeerConnection-setRemoteDescription.html +++ b/webrtc/RTCPeerConnection-setRemoteDescription.html
@@ -141,11 +141,31 @@ assert_session_desc_similar(pc.currentRemoteDescription, answer); }, 'Switching role from offerer to answerer after going back to stable state should succeed'); - /* - TODO - 4.3.2. setRemoteDescription - - If an a=identity attribute is present in the session description, the browser - validates the identity assertion. - */ + promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const offer = await pc.createOffer(); + const p = Promise.race([ + pc.setRemoteDescription(offer), + new Promise(r => t.step_timeout(() => r("timeout"), 200)) + ]); + pc.close(); + assert_equals(await p, "timeout"); + assert_equals(pc.signalingState, "closed", "In closed state"); + }, 'Closing on setRemoteDescription() neither resolves nor rejects'); + + promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const offer = await pc.createOffer(); + await pc.setLocalDescription(offer); + const p = Promise.race([ + pc.setRemoteDescription(offer), + new Promise(r => t.step_timeout(() => r("timeout"), 200)) + ]); + pc.close(); + assert_equals(await p, "timeout"); + assert_equals(pc.signalingState, "closed", "In closed state"); + }, 'Closing on rollback neither resolves nor rejects'); </script>